package com.yl.auth.controller;


import com.yl.auth.entity.Tigejiancha;
import com.yl.auth.service.TigejianchaService;
import com.yl.common.result.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author L
 * @since 2023-07-25
 */
@RestController
@RequestMapping("/admin/auth/tigejiancha")
@Api(tags = "体格检查")
public class TigejianchaController {
    @Resource
    private TigejianchaService tigejianchaService;

    /**
     * 根据老人id查询体格检查
     */
    @ApiOperation(value = "老人体格检查")
    @GetMapping("/getTige/{id}")
    public Result getTige(@PathVariable @ApiParam("老人id") Long id){
        Tigejiancha tigejiancha=tigejianchaService.getTige(id);
        return Result.ok(tigejiancha);
    }

    /**
     * 修改方法
     */
    @ApiOperation(value ="编辑老人体格")
    @PutMapping("/update")
    public Result update(@RequestBody Tigejiancha tigejiancha){
        tigejianchaService.updateById(tigejiancha);
        return Result.ok();
    }

}

